package com.xc.ezplan.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.xc.ezplan.core.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author lixingchen
 * @date 2022/11/15
 * @description 后台部门表
 */
@TableName(value ="admin_dept")
@Data
@ApiModel(description = "部门实体")
@EqualsAndHashCode(callSuper = true)
public class AdminDept extends BaseEntity {
    /**
     * 部门ID
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "部门ID")
    private Long id;

    /**
     * 上级部门ID
     */
    @ApiModelProperty(value = "上级部门ID")
    private Long pid;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String name;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer deptSort;

    /**
     * 状态 1-有效 0-无效
     */
    @ApiModelProperty(value = "状态 1-有效 0-无效")
    private Boolean enabled;

    @TableField(exist = false)
    private List<AdminDept> children;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}